<!DOCTYPE html>
<html lang="en">
<head>
<title>Maquetar</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="../../../css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="../../../css/style.css" type="text/css" media="all">
<script type="text/javascript" src="../../../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../../../js/cufon-yui.js"></script>
<script type="text/javascript" src="../../../js/cufon-replace.js"></script>
<script type="text/javascript" src="../../../js/Swis721_Cn_BT_400.font.js"></script>
<script type="text/javascript" src="../../../js/Swis721_Cn_BT_700.font.js"></script>
<script type="text/javascript" src="../../../js/tabs.js"></script>
<!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
	<style type="text/css">
		.bg{ behavior: url(js/PIE.htc); }
	</style>
<![endif]-->
<!--[if lt IE 7]>
		<div style=' clear: both; text-align:center; position: relative;'>
			<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0"  alt="" /></a>
		</div>
<![endif]-->
</head>
<body id="page4">
	<?php
	   session_start();
	   
	   $id_site = $_GET['id'];
	   if(isset($_SESSION['CODIGO_USUARIO'])){
	   $ID_User = $_SESSION['CODIGO_USUARIO'];   
		    ?> 
	

	<div class="body1">
	<div class="body2">
	<div class="body5">
		<div class="main">
<!-- header -->
                <?php
$link = mysql_connect("localhost","root","")or 
  die("Problemas en la conexion");
mysql_select_db("personalizatuweb", $link);

$result = mysql_query("SELECT * FROM usuarios where ID_USUARIO='".$ID_User."'", $link) or
  die("Problemas en la consulta SELECT:".mysql_error());
  
while($row = mysql_fetch_array($result) ){
	$NombreUser= $row['NOMBREUSUARIO'];
	$EmailUser= $row['EMAIL'];
    $FechaIncorporacionUser=$row['FECHAINCORPORACION'];
}
mysql_close($link);
 ?>
 
 
			<header>
				<div class="wrapper">
				<nav>
            
				<?php	 
 echo "<p style='float:left;'><b><u>DATOS DE USUARIO</u></b><br>"; 
 echo"NOMBRE: ".$NombreUser."<br>";
 echo"EMAIL: ".$EmailUser."<br>";
 echo"FECHA REGISTRO: ".$FechaIncorporacionUser."";

 ?>
					
					<ul id="menu">
						<li id="nav3"><a href="../../index.php">Mis<span>Sitios</span></a></li>
						<li id="nav2" class="active"><a>Crear<span>Sitio Web</span></a></li>
						<li id="nav4"><a>Mi<span>Cuenta</span></a></li>
						<li id="nav1"><a href="../../logout.php">Cerrar<span>Sesion</span></a></li>
					</ul>
				</nav>
				</div>
			</header>
		<!-- header end-->
		</div>
	</div>
	</div>
	</div>
	<div class="body3">
		<div class="main">
         
<!-- content -->
<div class="wrapper"> &nbsp;
<a id="BotonAddPage" href="#" onClick="VisibleForm()" >Agregar Pagina en Blanco </a>

<form id="newsletter" style="visibility:hidden" method="get" action="InsertarPage.php"> 
<input class="input" name="nombre" type="text" value="Ingrese Nombre" onBlur="if(this.value=='') this.value='Ingrese Nombre'" onFocus="if(this.value =='Ingrese Nombre' ) this.value=''" >
<input type="hidden" id="site" name="site" value="">
<a href="#" id="BTNsubmit"  onclick="AddPageBD()">Agregar</a> </form>  </div>
			<article id="content">
             <div class="wrapper">
					<h3 id="Informacion"><span class="dropcap">2</span>Maquetacion del Sitio Web</h3>
					
                    <?php
$link = mysql_connect("localhost","root","")or  die("Problemas en la conexion");
mysql_select_db("personalizatuweb", $link);

$result = mysql_query("SELECT * FROM pagina where ID_SITIO='".$_GET['id']."'", $link) or die("Problemas en la consulta SELECT:".mysql_error());
  
$CantResult = mysql_num_rows($result);

		if($CantResult > 0){
			
					$CONTADOR = 0;
						while($row = mysql_fetch_array($result) ){
						$CONTADOR = $CONTADOR + 1;

						$ID_PAGE = $row['ID_PAGINA'];
						$NOMBRE_PAGINA= $row['NOMBREPAGINA'];
						$URL_PAGINA= $row['URL'];?>
                
                      
                    
					
						<br><br>
                        
						<div class="wrapper pad_bot2">
                        <h5><figure class="left marg_right1"><img src="../../../images/PAGE.jpg" alt=""></figure>
						<?PHP echo "".$NOMBRE_PAGINA.""; ?></h5>
						<?PHP  if( strcmp($URL_PAGINA,"URL") != 0){  // strcmp, permie comparar string.-
						 ?>
						
                        <a href="<?php echo "./../../../".$URL_PAGINA ?>" class="link1" target="_blank" >Ver</a> &nbsp; 
						<?php }else
						  { ?> <a href="MaquetarPage.html?site=<?php echo $id_site ?>&page=<?php echo $ID_PAGE ?>" target="_blank" class="link1" >Maquetar</a>  <?php }?> &nbsp 
                       <a href="EliminarPage.php?site=<?php echo $id_site ?>&page=<?php echo $ID_PAGE ?>" class="link1">Eliminar Pagina</a>
						</div>
					    

								<?PHP } 
		}
mysql_close($link); ?>
						
					
						
					</div>
					
				</div>

			</article>
		</div>
	</div>
	<div class="body3">
		<div class="main">
			<article id="content2">
			<div class="wrapper"></div>
			</article>
<!-- content end -->
		</div>
	</div>
    
    
    <?php	   }else
		   
		   {
		   header ("Location: ../../../index.html");
		   	}
       ?> 
<script type="text/javascript"> Cufon.now(); 

function VisibleForm(){
	 $("#newsletter").css('visibility','visible');
}

function AddPageBD(){
	var sitio =  $.get("id");
	
	$("#site").val(sitio);
	$("#newsletter").submit();
	}
	

	(function($) {  
    $.get = function(key)   {  
        key = key.replace(/[\[]/, '\\[');  
        key = key.replace(/[\]]/, '\\]');  
        var pattern = "[\\?&]" + key + "=([^&#]*)";  
        var regex = new RegExp(pattern);  
        var url = unescape(window.location.href);  
        var results = regex.exec(url);  
        if (results === null) {  
            return null;  
        } else {  
            return results[1];  
        }  
    }  
})(jQuery);  
</script>
</body>
</html>